package com.ruyuan.eshop.common.service.aftersale.impl;

import com.ruyuan.eshop.common.service.aftersale.AfterSaleClientService;
import com.ruyuan.eshop.common.domain.entity.RefundDO;
import com.ruyuan.eshop.common.domain.vo.ApplyAfterSaleVO;
import com.ruyuan.eshop.common.enums.Permission;
import com.ruyuan.eshop.common.service.aftersale.AfterSaleService;
import com.ruyuan.eshop.common.service.aftersale.AfterSaleQueryService;
import com.ruyuan.eshop.common.service.aftersale.AfterSaleRefundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 售后client 默认实现
 * @author pwd
 * @version 1.0
 */
@Service
public class AfterSaleClientServiceDefaultImpl implements AfterSaleClientService {

    @Autowired
    protected AfterSaleService afterSaleService;

    @Autowired
    private AfterSaleQueryService afterSaleQueryService;

    @Autowired
    private AfterSaleRefundService afterSaleRefundService;

    @Override
    public void cancelPintuanOrder(String orderSn, String cancelReason) {
        afterSaleService.cancelPintuanOrder(orderSn, cancelReason);
    }

    @Override
    public ApplyAfterSaleVO detail(String serviceSn) {
        return afterSaleQueryService.detail(serviceSn, Permission.CLIENT);
    }

    @Override
    public RefundDO getAfterSaleRefundModel(String serviceSn) {
        return afterSaleRefundService.getModel(serviceSn);
    }

    @Override
    public void refundCompletion() {
        afterSaleService.refundCompletion();
    }

    @Override
    public void editAfterSaleShopName(Long shopId, String shopName) {
        afterSaleService.editAfterSaleShopName(shopId, shopName);
    }
}
